<html>
    <body>
        <div id="page-content-full">


            <?php echo validation_errors(); ?>
            <div id="info_usuario">
                <table id="TabTable" width="100%">
                    <!--<caption>Usuario</caption>-->

                    <thead>
                        <tr>
                            <th scope="col">Cédula</th>
                            <th scope="col">Nombre</th>
                            <th scope="col">Apellidos</th>
                            <th scope="col">Departamento</th>
                        </tr>
                    </thead>
                    <tfoot>
                        <tr>
                            <th></th><th></th>
                            <th></th><th></th>
                        </tr>
                    </tfoot>
                    <tbody>
                        <?php
                        if ($usuario <> NULL) {
                            echo "<tr>";
                            echo "<td>";
                            echo $usuario['cedula'];
                            echo "</td>";
                            echo "<td>";
                            echo $usuario['nombre'];
                            echo "</td>";
                            echo "<td>";
                            echo $usuario['apellidos'];
                            echo "</td>";
                            echo "<td>";
                            echo $usuario['departamento'];
                            echo "</td>";
                            echo "</tr>";
                        }
                        ?>
                    </tbody>
                </table>
            </div>
            <?php
            $attributes = array('id' => 'form');
            echo form_open('configuraciones/delete_confirm', $attributes)
            ?>
            <input type="hidden" value="<?php echo $usuario['cedula'] ?>" name="cedula" id="cedula"/>
            <br><p>Desea eliminar este usuario?</p><br>
            <input type="submit" name="Submit" value="Si" class="boton" id="si"/>
            <input type="submit" name="reset" value="No" class="boton" id="no"/>

        </form>

        <div class="clearfix"></div>
        <div class="shadow-main"></div>
    </div>

</body>


<script type="text/javascript">
    $('#si').click(function(){
        var id = $("#cedula").val();

        var form_data = {
            cedula: id,
            ajax: '1'
        };
        
        $.ajax({
            url: "<?php echo site_url('configuraciones/delete_confirm'); ?>",
            type: 'POST',
            data: form_data,
            success: function(msg){
                $('#mensaje').html(msg);        
                setTimeout('document.getElementById("form").reset();',1000);
                setTimeout('document.getElementById("mensaje").innerHTML="";',5000);
            }
        });
        document.getElementById("info_usuario").innerHTML="";
        
        return false; 
    });
    
    $('#no').click(function(){
        var form_data = {
            ajax: '0'
        };
        
        $.ajax({
            url: "<?php echo site_url('configuraciones/delete_confirm'); ?>",
            type: 'POST',
            data: form_data,
            success: function(msg){
                $('#mensaje').html(msg);      
                setTimeout('document.getElementById("form").reset();',2000);
                setTimeout('document.getElementById("mensaje").innerHTML="";',5000);
            }
        });
        document.getElementById("info_usuario").innerHTML="";
        
        return false; 
    });

    
</script>	

</html>
